﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DatNuocViet.Models
{
    public class WebResourceDAO
    {
        public static WebResource GetWebResource(string key)
        {
            try
            {
                DatNuocVietDbDataContext data = new DatNuocVietDbDataContext();

                var temp = data.GetWebResource(key).First();

                WebResource result = new WebResource();
                result.Key = key;
                result.ValueEN = temp.ValueEn;
                result.ValueVn = temp.ValueVn;

                return result;
            }
            catch
            {
                return new WebResource();
            }
        }

        public static List<GetGalleryResult> getgallery()
        {
            DatNuocVietDbDataContext data = new DatNuocVietDbDataContext();
            
            return data.GetGallery().ToList();
        }
    }
}